//
//  ByViewGetScoreFromPayMoreSectionHeader.m
//  mijifen_ios
//
//  Created by 朱凯 on 2017/11/8.
//  Copyright © 2017年 itboye. All rights reserved.
//

#import "ByViewGetScoreFromPayMoreSectionHeader.h"

@implementation ByViewGetScoreFromPayMoreSectionHeader
{
    UILabel *_titleLabel;
}
- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
    }
    return self;
}
- (void)setupUI {
    
    _titleLabel = [[UILabel alloc] init];
    _titleLabel.adjustsFontSizeToFitWidth = true;
    _titleLabel.numberOfLines = 1;
    _titleLabel.text = @"";
    _titleLabel.font = FONT(14);
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    _titleLabel.textColor = BY_RED_COLOR;
    [self.contentView addSubview:_titleLabel];
    
    // 线条
    UIView *line1 = [UIView new];
    line1.backgroundColor = BY_RED_COLOR;
    [self.contentView addSubview:line1];
    UIView *line2 = [UIView new];
    line2.backgroundColor = BY_RED_COLOR;
    [self.contentView addSubview:line2];
    
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.contentView);
    }];
    [line1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.equalTo(@50);
        make.right.equalTo(_titleLabel.mas_left).offset(-10);
        make.centerY.equalTo(@0);
        make.height.equalTo(@1);
    }];
    [line2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_titleLabel.mas_right).offset(10);
        make.centerY.height.width.equalTo(line1);
    }];
 
    
}

- (void)setTitle:(NSString *)title {
    
    _title = title;
    
    _titleLabel.text = title;
}

@end
